﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CookieLogin
{
    public partial class Info : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["login"];
            if (cookie != null)
            {
                string[] words = cookie.Value.Split(' ');
                this.userNameLbl.Text = words[0];
                if (words.Length > 1)
                {
                    this.passLbl.Text = words[1];
                }
            }
            else
            {
                Response.Clear();
                Response.Redirect("Login.aspx");
            }
        }
    }
}